package com.example.bishe.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.bishe.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.bishe.web.b.vo.getUserPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LDH
 * @since 2022/11/30
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("SELECT * FROM `user` WHERE open_id=#{openId} ")
    User getByOpenId(String openId);

    IPage<getUserPageVO> getPage(IPage<getUserPageVO> page,
                                 @Param("id") Long id,
                                 @Param("name") String name,
                                 @Param("startTime") String startTime,
                                 @Param("endTime") String endTime,
                                 @Param("state") String state,
                                 @Param("roomNum") Integer roomNum
    );

}
